home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 031a / winsql20.zip / SYNTAX.DOC < prev    next >
Text File  |  1991-10-26  |  63KB  |  2,109 lines

  1.  
  2.           Orion SQL Syntax                                  Page 1 of 34
  3.  
  4.  
  5.                               Orion SQL For Windows
  6.  
  7.                            Release 2.0 - November 1991
  8.  
  9.  
  10.                                  ORION SQL SYNTAX
  11.  
  12.  
  13.                      Copyright (c) 1991 by Stellar Industries
  14.                                All Rights Reserved
  15.  
  16.  
  17.                                      Summary
  18.  
  19.  
  20.           This manual is divided into nine sections:
  21.  
  22.           Overview       This section describes, in general terms, what
  23.                          SQL is and the notation used in this document.
  24.  
  25.           Statements     This section includes a description of the
  26.                          syntax of all SQL Statements which your program
  27.                          can use.
  28.  
  29.           Data Types     This section includes a description of all data
  30.                          types recognized by SQL.
  31.  
  32.           Operators      This section includes a description of all
  33.                          arithmetic operators used with SQL.
  34.  
  35.           Built-in Functions This section includes a description of all
  36.                          built-in functions used with SQL.
  37.  
  38.           Expressions    This section includes a description of the
  39.                          syntax of expressions used with SQL.
  40.  
  41.           Search Condition This section includes a description of the
  42.                          syntax used to select specific data elements.
  43.  
  44.           System Catalog This section includes a description of the
  45.                          tables used by the Orion Database Administrator
  46.                          to keep track of the database.
  47.  
  48.           Glossary       This section defines specialized terms used in
  49.                          this document.
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                  Summary
  64.           Orion SQL Syntax                                  Page 2 of 34
  65.  
  66.  
  67.                                      Overview
  68.  
  69.  
  70.           General Information
  71.  
  72.                     Structured Query Language (SQL) is the database
  73.                     management language declared by the American
  74.                     National Standards Institute (ANSI) as a standard.
  75.                     SQL is the lingua franca of the computer database
  76.                     world.  SQL is used on mainframes, minicomputers and
  77.                     PCs.
  78.  
  79.           Notational Conventions
  80.  
  81.                     While uppercase is used throughout this document to
  82.                     indicate SQL keywords (COMMIT, SELECT, etc), in
  83.                     actuality the Orion Database Administrator will
  84.                     accept keywords in either upper or lowercase.  The
  85.                     keyword 'COMMIT' may be spelled 'commit', 'Commit',
  86.                     'COMMIT', etc.
  87.  
  88.                     The names of users, tables, indices and columns, and
  89.                     the content of character fields are, however, case
  90.                     sensitive.  If you used some combination of upper
  91.                     and lower case to create them, you have to use the
  92.                     same combination to access them.  All system names
  93.                     were created using upper case only.
  94.  
  95.                     Optional elements are indicated by enclosing them
  96.                     within square brackets as in [option].  When a
  97.                     choice may be made among a list of possible optional
  98.                     elements, individual selections are separated by
  99.                     vertical bars as in [option1 | option2 | option3].
  100.  
  101.                     When a pattern may be repeated, an ellipsis follows
  102.                     the pattern as in "ColumnName1 [, ColumnName2] ...".
  103.                     This example implies a list of one or more column
  104.                     names separated by commas.
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.                                                                 Overview
  126.           Orion SQL Syntax                                  Page 3 of 34
  127.  
  128.  
  129.                                     Statements
  130.  
  131.  
  132.           SQL is based on various uses of the following statements:
  133.  
  134.           COMMIT WORK    Instructs the database administrator to make
  135.                          all changes to the database by the current
  136.                          transaction permanent.
  137.  
  138.           CREATE INDEX   Creates an index on a database table.
  139.  
  140.           CREATE TABLE   Creates a database table.
  141.  
  142.           DELETE         Deletes records from a database table.
  143.  
  144.           DROP INDEX     Deletes an index from a database table.
  145.  
  146.           DROP TABLE     Deletes a database table.
  147.  
  148.           INSERT         Creates records in a database table.
  149.  
  150.           ROLLBACK WORK  Instructs the database administrator to forget
  151.                          all changes made to the database by the current
  152.                          transaction.
  153.  
  154.           SELECT         Retrieves data from database tables.
  155.  
  156.           UPDATE         Modifies the content of records within database
  157.                          tables.
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.                                                               Statements
  188.           Orion SQL Syntax                                  Page 4 of 34
  189.  
  190.  
  191.                               Statement: COMMIT WORK
  192.  
  193.  
  194.           Syntax         COMMIT WORK;
  195.  
  196.                          Changes made to the database are not made
  197.                          permanent until this statement is executed.
  198.                          Should the current user execute a ROLLBACK WORK
  199.                          or unexpectedly log off, all changes made by
  200.                          the user since logging in or executing a COMMIT
  201.                          WORK (whichever occurred most recently) will
  202.                          vanish.
  203.  
  204.                          During database recovery only committed
  205.                          transactions are restored.
  206.  
  207.           Comments       As queries are executed within a transaction
  208.                          and records are created, read, updated or
  209.                          deleted; the database applies various kinds of
  210.                          locks on the applicable records.  These locks
  211.                          are released when the transaction is committed
  212.                          or rolled back.  In order to minimize the
  213.                          conflict between transactions, be sure to
  214.                          minimize the amount of time these locks are in
  215.                          place by issuing a COMMIT WORK or ROLLBACK WORK
  216.                          whenever possible.
  217.  
  218.                          Committing a transaction automatically starts a
  219.                          new transaction.  COMMIT WORK is very fast
  220.                          since the changes have already been made, they
  221.                          are merely flagged as permanent.
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.                                                  Statements: COMMIT WORK
  250.           Orion SQL Syntax                                  Page 5 of 34
  251.  
  252.  
  253.                              Statement: CREATE INDEX
  254.  
  255.  
  256.           Syntax         CREATE [UNIQUE] INDEX
  257.                            [CreatorName.]IndexName
  258.                            ON [UserName.]TableName (
  259.                              ColumnName1 [ASC | DESC][,
  260.                              ColumnName2 [ASC | DESC]]
  261.                              ...
  262.                            );
  263.  
  264.                          This statement creates the index IndexName on
  265.                          the table TableName.  While indices are never
  266.                          referenced explicitly in SQL (other than
  267.                          creating and dropping them), they are used
  268.                          extensively by the Orion Database Administrator
  269.                          to maximize system performance.
  270.  
  271.                          Phrase         Description
  272.  
  273.                          CREATE [UNIQUE] INDEX
  274.  
  275.                                         Specify UNIQUE if you wish key
  276.                                         values to be distinguishable,
  277.                                         one from another, across the
  278.                                         entire table upon which the
  279.                                         index is constructed.  If an
  280.                                         attempt is made to create a
  281.                                         record in the table which
  282.                                         violates this unique constraint,
  283.                                         an error condition will arise.
  284.  
  285.                          [CreatorName.]IndexName
  286.  
  287.                                         IndexName becomes the name of
  288.                                         the newly created index.
  289.                                         Specify CreatorName if you wish
  290.                                         the index to belong to a user
  291.                                         different from the current user.
  292.  
  293.                          ON [UserName.]TableName
  294.  
  295.                                         TableName identifies the table
  296.                                         upon which the index is to be
  297.                                         constructed.  Specify UserName
  298.                                         if the table belongs to a user
  299.                                         different from the current user.
  300.  
  301.                          ColumnName1 [ASC | DESC]
  302.  
  303.                                         ColumnName identifies a column
  304.                                         in the table to be included in
  305.                                         the index key.  Specify ASC for
  306.                                         ascending and DESC for
  307.  
  308.  
  309.  
  310.  
  311.                                                 Statements: CREATE INDEX
  312.           Orion SQL Syntax                                  Page 6 of 34
  313.  
  314.  
  315.                                         descending.  ASC is default.  We
  316.                                         recommend against the use of
  317.                                         DESC, it is included in order to
  318.                                         conform to the ANSI standard.
  319.  
  320.                          [, ColumnName2 [ASC | DESC]] ...
  321.  
  322.                                         Additional columns may be
  323.                                         included within the index key by
  324.                                         creating a list of columns
  325.                                         separated by commas.  The index
  326.                                         key will be constructed in the
  327.                                         order in which columns appear in
  328.                                         this list.
  329.  
  330.           Comments       While indices may be created at anytime, we
  331.                          recommend that you create indices immediately
  332.                          after you create their base table; otherwise,
  333.                          CREATE INDEX has to read and rewrite all data
  334.                          which is already in the table.
  335.  
  336.                          The presence of suitable indices may greatly
  337.                          enhance system performance.  Indices do,
  338.                          however, cause a moderate increase in the
  339.                          amount of time it takes to write a record to
  340.                          the table upon which the index is constructed.
  341.                          The database user should add indices
  342.                          judiciously.
  343.  
  344.                          ColumnName, CreatorName, IndexName, TableName
  345.                          and UserName are limited to 32 characters.
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.                                                 Statements: CREATE INDEX
  374.           Orion SQL Syntax                                  Page 7 of 34
  375.  
  376.  
  377.                              Statement: CREATE TABLE
  378.  
  379.  
  380.           Syntax         CREATE TABLE [UserName.]TableName (
  381.                            ColumnName1 DataType1 [NOT NULL [UNIQUE]][,
  382.                            ColumnName2 DataType2 [NOT NULL [UNIQUE]]]
  383.                            ...
  384.                            [UNIQUE (ColumnNameA[, ColumnNameB] ... )][,
  385.                            UNIQUE (ColumnNameA[, ColumnNameB] ... )]
  386.                            ...
  387.                          );
  388.  
  389.                          This statement creates the table TableName with
  390.                          the columns as specified.
  391.  
  392.                          Phrase         Description
  393.  
  394.                          CREATE TABLE [UserName.]TableName
  395.  
  396.                                         TableName becomes the name of
  397.                                         the newly created table.
  398.                                         Specify UserName if you wish the
  399.                                         table to belong to a user
  400.                                         different from the current user.
  401.  
  402.                          ColumnName1 DataType1 [NOT NULL [UNIQUE]]
  403.  
  404.                                         ColumnName identifies a column
  405.                                         to be included in the table.
  406.                                         DataType indicates the data type
  407.                                         of the column.
  408.  
  409.                                         When a column is specified as
  410.                                         NOT NULL, any attempt to insert
  411.                                         or update a record which would
  412.                                         result in a NULL value in this
  413.                                         column will cause an error
  414.                                         condition to arise.
  415.  
  416.                                         When a column is specified as
  417.                                         UNIQUE, an UNIQUE index is
  418.                                         automatically created for that
  419.                                         column.  This index will insure
  420.                                         that all values for that column
  421.                                         are distinguishable, one from
  422.                                         another, across the entire
  423.                                         table.  Any attempt to insert or
  424.                                         update a record which violates
  425.                                         this unique constraint will
  426.                                         cause an error condition to
  427.                                         arise.
  428.  
  429.                          [, ColumnName2 DataType2 [NOT NULL UNIQUE]]]
  430.                                         ...
  431.  
  432.  
  433.  
  434.  
  435.                                                 Statements: CREATE TABLE
  436.           Orion SQL Syntax                                  Page 8 of 34
  437.  
  438.  
  439.                                         Additional columns may be
  440.                                         included within the table by
  441.                                         creating a list of column
  442.                                         definitions separated by commas.
  443.  
  444.                          [UNIQUE (ColumnNameA[, ColumnNameB] ... )]
  445.  
  446.                                         The combination of ColumnNameA,
  447.                                         ColumnNameB, ... are to be
  448.                                         unique across all records in the
  449.                                         table.
  450.  
  451.                                         An UNIQUE index which includes
  452.                                         the named columns is
  453.                                         automatically created.  This
  454.                                         index will insure that key
  455.                                         values for these columns are
  456.                                         distinguishable, one from
  457.                                         another, across the entire
  458.                                         table.  Any attempt to insert or
  459.                                         update a record which violates
  460.                                         this unique constraint will
  461.                                         cause an error condition to
  462.                                         arise.
  463.  
  464.                          [, UNIQUE (ColumnNameN[, ColumnNameO] ... )]
  465.  
  466.                                         Additional unique constraints
  467.                                         may be added by creating a list
  468.                                         of unique constraint definitions
  469.                                         separated by commas.  Each
  470.                                         unique constraint is maintained
  471.                                         by a separate UNIQUE index.
  472.  
  473.           Comments       ColumnName, TableName and UserName are limited
  474.                          to 32 characters.
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.                                                 Statements: CREATE TABLE
  498.           Orion SQL Syntax                                  Page 9 of 34
  499.  
  500.  
  501.                                 Statement: DELETE
  502.  
  503.  
  504.           Syntax         DELETE FROM [UserName.]TableName
  505.                            [WHERE SearchCondition];
  506.  
  507.                          This statement deletes records from the table
  508.                          TableName.  SearchCondition specifies which
  509.                          records are to be deleted.
  510.  
  511.                          Phrase         Description
  512.  
  513.                          DELETE FROM [UserName.]TableName
  514.  
  515.                                         TableName is the name of the
  516.                                         table containing the records to
  517.                                         be deleted.  Specify UserName if
  518.                                         the table belongs to a user
  519.                                         different from the current user.
  520.  
  521.                          WHERE SearchCondition
  522.  
  523.                                         SearchCondition specifies which
  524.                                         records are to be deleted.
  525.  
  526.           Comments       TableName and UserName are limited to 32
  527.                          characters.
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.                                                       Statements: DELETE
  560.           Orion SQL Syntax                                 Page 10 of 34
  561.  
  562.  
  563.                               Statement: DROP INDEX
  564.  
  565.  
  566.           Syntax         DROP INDEX [CreatorName.]IndexName
  567.                            ON [UserName.]TableName;
  568.  
  569.                          This statement deletes the index IndexName on
  570.                          the table TableName.
  571.  
  572.                          Phrase         Description
  573.  
  574.                          DROP INDEX [CreatorName.]IndexName
  575.  
  576.                                         IndexName is the name of the
  577.                                         index to be deleted.  Specify
  578.                                         CreatorName if the index belongs
  579.                                         to a user different from the
  580.                                         current user.
  581.  
  582.                          ON [UserName.]TableName
  583.  
  584.                                         TableName identifies the table
  585.                                         upon which the index exists.
  586.                                         Specify UserName if the table
  587.                                         belongs to a user different from
  588.                                         the current user.
  589.  
  590.           Comments       While indices may be dropped at anytime,
  591.                          dropping an index on a table causes the entire
  592.                          table to be rebuilt.
  593.  
  594.                          When a table is deleted, all indices associated
  595.                          with that table are automatically dropped.
  596.  
  597.                          CreatorName, IndexName, TableName and UserName
  598.                          are limited to 32 characters
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.                                                   Statements: DROP INDEX
  622.           Orion SQL Syntax                                 Page 11 of 34
  623.  
  624.  
  625.                               Statement: DROP TABLE
  626.  
  627.  
  628.           Syntax         DROP TABLE [UserName.]TableName;
  629.  
  630.                          This statement deletes the table TableName.
  631.  
  632.                          Phrase         Description
  633.  
  634.                          DROP TABLE [UserName.]TableName
  635.  
  636.                                         TableName is the name of the
  637.                                         table to be deleted.  Specify
  638.                                         UserName if the table belongs to
  639.                                         a user different from the
  640.                                         current user.
  641.  
  642.           Comments       All indices associated with the table are
  643.                          automatically dropped.
  644.  
  645.                          TableName and UserName are limited to 32
  646.                          characters
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.                                                   Statements: DROP TABLE
  684.           Orion SQL Syntax                                 Page 12 of 34
  685.  
  686.  
  687.                                 Statement: INSERT
  688.  
  689.  
  690.           Syntax         INSERT INTO [UserName.]TableName
  691.                            [(ColumnName1[, ColumnName2] ... )]
  692.                            VALUES (Value1[, Value2] ... );
  693.  
  694.           -- or --
  695.  
  696.           Syntax         INSERT INTO [UserName.]TableName
  697.                            [(ColumnName1[, ColumnName2] ... )]
  698.                            SelectStatement;
  699.  
  700.                          This statement inserts records into the table
  701.                          TableName.
  702.  
  703.                          Phrase         Description
  704.  
  705.                          INSERT INTO [UserName.]TableName
  706.  
  707.                                         TableName is the name of the
  708.                                         table into which records are to
  709.                                         be inserted.  Specify UserName
  710.                                         if the table belongs to a user
  711.                                         different from the current user.
  712.  
  713.                          (ColumnName1[, ColumnName2] ... )
  714.  
  715.                                         Identifies columns into which
  716.                                         data is to be deposited.  If any
  717.                                         columns exist in the table which
  718.                                         are not listed, they are set to
  719.                                         the NULL value.  A column name
  720.                                         may not be repeated.  Column
  721.                                         names do not have to be in the
  722.                                         same order as they are in the
  723.                                         table itself.
  724.  
  725.                          VALUES (Value1[, Value2] ... )
  726.  
  727.                                         Specifies the values to be
  728.                                         deposited in the record.  If a
  729.                                         list of columns was supplied,
  730.                                         there must be a match between
  731.                                         the number of column names in
  732.                                         the list and the number of
  733.                                         values supplied.  If a list of
  734.                                         columns was not supplied, there
  735.                                         must be a match between the
  736.                                         total number of columns in the
  737.                                         table and the number of values
  738.                                         supplied.
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.                                                       Statements: INSERT
  746.           Orion SQL Syntax                                 Page 13 of 34
  747.  
  748.  
  749.                                         The data type of the value must
  750.                                         be compatible with the data type
  751.                                         of the column into which it is
  752.                                         to be deposited.  When the
  753.                                         column allows the NULL value,
  754.                                         the value may be 'NULL'.
  755.  
  756.                          SelectStatement
  757.  
  758.                                         The SelectStatement generates a
  759.                                         set of records to be inserted.
  760.                                         If a list of columns was
  761.                                         supplied, there must be a match
  762.                                         between the number of column
  763.                                         names in the list and the number
  764.                                         of columns generated by the
  765.                                         SelectStatement.  If a list of
  766.                                         columns was not supplied, there
  767.                                         must be a match between the
  768.                                         total number of columns in the
  769.                                         table and the number of columns
  770.                                         generated by the
  771.                                         SelectStatement.
  772.  
  773.                                         The data types of the columns
  774.                                         generated by the SelectStatement
  775.                                         must be compatible with the data
  776.                                         types of the columns into which
  777.                                         they are to be deposited.
  778.  
  779.           Comments       ColumnName, TableName and UserName are limited
  780.                          to 32 characters.
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.                                                       Statements: INSERT
  808.           Orion SQL Syntax                                 Page 14 of 34
  809.  
  810.  
  811.                              Statement: ROLLBACK WORK
  812.  
  813.  
  814.           Syntax         ROLLBACK WORK;
  815.  
  816.                          Changes made to the database are not made
  817.                          permanent until a COMMIT WORK statement is
  818.                          executed.  ROLLBACK WORK instructs the database
  819.                          to purge all changes to the database by the
  820.                          current user since logging in or executing a
  821.                          COMMIT WORK (whichever occurred most recently).
  822.  
  823.           Comments       As queries are executed within a transaction
  824.                          and records are created, read, updated or
  825.                          deleted; the database applies various kinds of
  826.                          locks on the applicable records.  These locks
  827.                          are released when the transaction is committed
  828.                          or rolled back.  In order to minimize the
  829.                          conflict between transactions, be sure to
  830.                          minimize the amount of time these locks are in
  831.                          place by issuing a COMMIT WORK or ROLLBACK WORK
  832.                          whenever possible.
  833.  
  834.                          Rolling a transaction back automatically starts
  835.                          a new transaction.  ROLLBACK WORK may take some
  836.                          time while the database administrator purges
  837.                          updates.
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.                                                Statements: ROLLBACK WORK
  870.           Orion SQL Syntax                                 Page 15 of 34
  871.  
  872.  
  873.                                 Statement: SELECT
  874.  
  875.  
  876.           Syntax         SELECT [ALL | DISTINCT]
  877.                            Expression1[, Expression2] ...
  878.                            FROM [UserName1.]TableName1 [CorrelationName1][,
  879.                              [UserName2.]TableName2 [CorrelationName2]]
  880.                              ...
  881.                            [WHERE SearchCondition]
  882.                            [GROUP BY ColumnSpecification1[,
  883.                              ColumnSpecification2]
  884.                              ...
  885.                              [HAVING SearchCondition]]
  886.                            [ORDER BY ColumnSpecificationA [ASC | DESC][,
  887.                              ColumnSpecificationB [ASC | DESC]]
  888.                              ...];
  889.  
  890.                          This statement generates a result table.  There
  891.                          is one column in the result table for each
  892.                          Expression in the expression list of the SELECT
  893.                          statement.  The values deposited in the columns
  894.                          of the result table are generated by evaluating
  895.                          the corresponding Expression.
  896.  
  897.                          Phrase         Description
  898.  
  899.                          SELECT [ALL | DISTINCT]
  900.  
  901.                                         ALL is default.  DISTINCT
  902.                                         insures that all records in the
  903.                                         result table are
  904.                                         distinguishable, one from
  905.                                         another.  When DISTINCT is
  906.                                         specified, duplicate records are
  907.                                         eliminated from the result
  908.                                         table.
  909.  
  910.                          Expression1[, Expression2]
  911.  
  912.                                         This list specifies the values
  913.                                         to be inserted into the columns
  914.                                         of the result table.  The data
  915.                                         types of the columns of the
  916.                                         result table are determined by
  917.                                         the data types of the values
  918.                                         resulting from the expressions
  919.                                         in this list.
  920.  
  921.                                         You may substitute a single '*'
  922.                                         in place of the list of
  923.                                         expressions.  '*' implies a list
  924.                                         of all columns of all tables
  925.                                         identified in the FROM clause.
  926.  
  927.  
  928.  
  929.  
  930.  
  931.                                                       Statements: SELECT
  932.           Orion SQL Syntax                                 Page 16 of 34
  933.  
  934.  
  935.                                         You may not use '*' if you use
  936.                                         the GROUP BY clause.
  937.  
  938.                          FROM [UserName1.]TableName1 [CorrelationName1]
  939.  
  940.                                         TableName is the name of the
  941.                                         table from which records are to
  942.                                         be read.  Specify UserName if
  943.                                         the table belongs to a user
  944.                                         different from the current user.
  945.  
  946.                                         CorrelationName is effectively
  947.                                         an alias for the TableName which
  948.                                         it follows.
  949.  
  950.                          [, [UserName2.]TableName2 [CorrelationName2]]
  951.                                         ...
  952.  
  953.                                         Additional tables may be
  954.                                         included by creating a list of
  955.                                         tables separated by commas.
  956.                                         This effectively creates a
  957.                                         Cartesian product of all the
  958.                                         tables in the list.
  959.  
  960.                          WHERE SearchCondition
  961.  
  962.                                         SearchCondition specifies which
  963.                                         records are to be read.
  964.  
  965.                          GROUP BY ColumnSpecification1
  966.  
  967.                                         Rearranges the table(s)
  968.                                         identified by the FROM clause
  969.                                         into groups such that within any
  970.                                         one group all rows have the same
  971.                                         value for the GROUP BY
  972.                                         column(s).  The SELECT clause is
  973.                                         then applied to these groups.
  974.                                         Each group generates a single
  975.                                         record in the result table.
  976.  
  977.                                         Please refer to a text book for
  978.                                         a description of the "grouped
  979.                                         table".  "Grouped tables" are
  980.                                         fully supported by the Orion
  981.                                         Database Administrator.
  982.  
  983.                          [, ColumnSpecification2] ...
  984.  
  985.                                         Additional columns may be
  986.                                         included within the GROUP BY
  987.                                         clause by creating a list of
  988.                                         columns separated by commas.
  989.  
  990.  
  991.  
  992.  
  993.                                                       Statements: SELECT
  994.           Orion SQL Syntax                                 Page 17 of 34
  995.  
  996.  
  997.                                         Please refer to a text book for
  998.                                         a description of the "grouped
  999.                                         table".  "Grouped tables" are
  1000.                                         fully supported by the Orion
  1001.                                         Database Administrator.
  1002.  
  1003.                          HAVING SearchCondition
  1004.  
  1005.                                         Specifies a restriction on the
  1006.                                         grouped table resulting from the
  1007.                                         GROUP BY clause by eliminating
  1008.                                         groups not meeting the
  1009.                                         SearchCondition.
  1010.  
  1011.                                         Please refer to a text book for
  1012.                                         a description of the "grouped
  1013.                                         table".  "Grouped tables" are
  1014.                                         fully supported by the Orion
  1015.                                         Database Administrator.
  1016.  
  1017.                          ORDER BY ColumnSpecificationA [ASC | DESC]
  1018.  
  1019.                                         Records in the result table will
  1020.                                         be sorted on the basis of the
  1021.                                         data in the columns specified by
  1022.                                         the ORDER BY clause.  Specify
  1023.                                         ASC for ascending and DESC for
  1024.                                         descending.  ASC is default.
  1025.  
  1026.                                         ColumnSpecification must
  1027.                                         identify one of the Expressions
  1028.                                         within the list of expressions
  1029.                                         of the SELECT STATEMENT.  An
  1030.                                         integer may be used in place of
  1031.                                         the ColumnSpecification; when an
  1032.                                         integer is used it identifies
  1033.                                         which column in the result table
  1034.                                         is to be used to determine the
  1035.                                         order.
  1036.  
  1037.                          [, ColumnSpecificationB [ASC | DESC]] ...
  1038.  
  1039.                                         Additional ordering
  1040.                                         ColumnSpecifications (or
  1041.                                         integers) may be included within
  1042.                                         the ORDER BY clause by creating
  1043.                                         a list of columns (or integers)
  1044.                                         separated by commas.
  1045.  
  1046.           Comments       CorrelationName, TableName and UserName are
  1047.                          limited to 32 characters.
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.                                                       Statements: SELECT
  1056.           Orion SQL Syntax                                 Page 18 of 34
  1057.  
  1058.  
  1059.                                 Statement: UPDATE
  1060.  
  1061.  
  1062.           Syntax         UPDATE [UserName.]TableName
  1063.                            SET ColumnName1 = Expression1[,
  1064.                              ColumnName2 = Expression2]
  1065.                              ...
  1066.                            [WHERE SearchCondition];
  1067.  
  1068.                          This statement modifies records in the table
  1069.                          TableName.  SearchCondition specifies which
  1070.                          records are to be modified.
  1071.  
  1072.                          Phrase         Description
  1073.  
  1074.                          UPDATE [UserName.]TableName
  1075.  
  1076.                                         TableName is the name of the
  1077.                                         table in which records are to be
  1078.                                         modified.  Specify UserName if
  1079.                                         the table belongs to a user
  1080.                                         different from the current user.
  1081.  
  1082.                          SET ColumnName1 = Expression1
  1083.  
  1084.                                         Expression is evaluated and the
  1085.                                         result placed in the column
  1086.                                         identified by ColumnName.
  1087.                                         Columns not specifically
  1088.                                         identified are left unaffected.
  1089.  
  1090.                          [, ColumnName2 = Expression2] ...
  1091.  
  1092.                                         Additional columns may be
  1093.                                         modified by creating a list of
  1094.                                         ColumnNames and Expressions
  1095.                                         separated by commas.  A column
  1096.                                         name may not be repeated.
  1097.  
  1098.                          [WHERE SearchCondition]
  1099.  
  1100.                                         SearchCondition specifies which
  1101.                                         records are to be modified.
  1102.  
  1103.           Comments       ColumnName, TableName and UserName are limited
  1104.                          to 32 characters.
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.                                                       Statements: UPDATE
  1118.           Orion SQL Syntax                                 Page 19 of 34
  1119.  
  1120.  
  1121.                                     Data Types
  1122.  
  1123.  
  1124.           Data types are organized into three basic categories:
  1125.  
  1126.           Approximate Numeric This type is typically referred to as
  1127.                          floating point.
  1128.  
  1129.           Exact Numeric  This type is typically referred to as fixed
  1130.                          point.
  1131.  
  1132.           Character String This type is used to store text.
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.                                                               Data Types
  1180.           Orion SQL Syntax                                 Page 20 of 34
  1181.  
  1182.  
  1183.                          Data Types: Approximate Numeric
  1184.  
  1185.  
  1186.           This type is typically referred to as floating point.
  1187.  
  1188.           Data type      Description
  1189.  
  1190.           FLOAT          Floating point number with magnitude ranging
  1191.                          from approximately 1.7976931348623158e+308 to
  1192.                          2.2250738585072014e-308.
  1193.  
  1194.           FLOAT(p)       Floating point number with p significant
  1195.                          digits, with magnitude ranging from
  1196.                          approximately 1.7976931348623158e+308 to
  1197.                          2.2250738585072014e-308.
  1198.  
  1199.           REAL           Floating point number with magnitude ranging
  1200.                          from approximately 1.7976931348623158e+308 to
  1201.                          2.2250738585072014e-308.
  1202.  
  1203.           DOUBLE PRECISION Floating point number with magnitude ranging
  1204.                          from approximately 1.7976931348623158e+308 to
  1205.                          2.2250738585072014e-308.
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.                                          Data Types: Approximate Numeric
  1242.           Orion SQL Syntax                                 Page 21 of 34
  1243.  
  1244.  
  1245.                             Data Types: Exact Numeric
  1246.  
  1247.  
  1248.           This type is typically referred to as fixed point.
  1249.  
  1250.           Data type      Description
  1251.  
  1252.           DEC            Signed decimal number with up to 19 digits of
  1253.                          which 0 appear to the right of the decimal
  1254.                          point.
  1255.  
  1256.           DEC(p)         Signed decimal number with up to p digits of
  1257.                          which 0 appear to the right of the decimal
  1258.                          point; 1 <= p <= 19.
  1259.  
  1260.           DEC(p, s)      Signed decimal number with up to p digits of
  1261.                          which s appear to the right of the decimal
  1262.                          point; 1 <= p <= 19 and 0 <= s <= p.
  1263.  
  1264.           DECIMAL        Signed decimal number with up to 19 digits of
  1265.                          which 0 appear to the right of the decimal
  1266.                          point.
  1267.  
  1268.           DECIMAL(p)     Signed decimal number with up to p digits of
  1269.                          which 0 appear to the right of the decimal
  1270.                          point; 1 <= p <= 19.
  1271.  
  1272.           DECIMAL(p, s)  Signed decimal number with up to p digits of
  1273.                          which s appear to the right of the decimal
  1274.                          point; 1 <= p <= 19 and 0 <= s <= p.
  1275.  
  1276.           INT            Whole number ranging from -2147483647 to
  1277.                          2147483647.
  1278.  
  1279.           INTEGER        Whole number ranging from -2147483647 to
  1280.                          2147483647.
  1281.  
  1282.           NUMERIC        Signed decimal number with up to 19 digits of
  1283.                          which 0 appear to the right of the decimal
  1284.                          point.
  1285.  
  1286.           NUMERIC(p)     Signed decimal number with up to p digits of
  1287.                          which 0 appear to the right of the decimal
  1288.                          point; 1 <= p <= 19.
  1289.  
  1290.           NUMERIC(p, s)  Signed decimal number with up to p digits of
  1291.                          which s appear to the right of the decimal
  1292.                          point; 1 <= p <= 19 and 0 <= s <= p.
  1293.  
  1294.           SMALLINT       Whole number ranging from -2147483647 to
  1295.                          2147483647.
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.                                                Data Types: Exact Numeric
  1304.           Orion SQL Syntax                                 Page 22 of 34
  1305.  
  1306.  
  1307.                            Data Types: Character String
  1308.  
  1309.  
  1310.           This type is used to store text.
  1311.  
  1312.           Data type      Description
  1313.  
  1314.           CHAR           Character data, length assumed to be 1.
  1315.  
  1316.           CHAR(n)        Character data, length specified by n where 1
  1317.                          <= n <= 2047.
  1318.  
  1319.           CHARACTER      Character data, length assumed to be 1.
  1320.  
  1321.           CHARACTER(n)   Character data, length specified by n where 1
  1322.                          <= n <= 2047.
  1323.  
  1324.           VARCHAR        Character data, variable length where maximum
  1325.                          length is 2047.
  1326.  
  1327.           VARCHAR(n)     Character data, variable length where maximum
  1328.                          length is specified by n where 1 <= n <= 2047.
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.                                             Data Types: Character String
  1366.           Orion SQL Syntax                                 Page 23 of 34
  1367.  
  1368.  
  1369.                                     Operators
  1370.  
  1371.  
  1372.           The arithmetic operators have their usual meanings:
  1373.  
  1374.           +              The value on the right is added to the value on
  1375.                          the left.
  1376.  
  1377.           -              The value on the right is subtracted from the
  1378.                          value on the left.
  1379.  
  1380.           *              The value on the right is multiplied by the
  1381.                          value on the left.
  1382.  
  1383.           /              The value on the left is divided by the value
  1384.                          on the right.
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.                                                                Operators
  1428.           Orion SQL Syntax                                 Page 24 of 34
  1429.  
  1430.  
  1431.                                 Built-in functions
  1432.  
  1433.  
  1434.           Built-in functions act on several rows in a table together.
  1435.           Built-in functions may not be nested.  SQL supports the
  1436.           following built-in functions:
  1437.  
  1438.           AVG(Expression)          For each record selected, Expression
  1439.                                    is analyzed and a value obtained.
  1440.                                    AVG returns the average of these
  1441.                                    values.  Only values which are not
  1442.                                    NULL are included.
  1443.  
  1444.           COUNT(DISTINCT Expression) For each record selected,
  1445.                                    Expression is analyzed and a value
  1446.                                    obtained.  COUNT(DISTINCT) returns
  1447.                                    the number of these values which are
  1448.                                    distinguishable, one from another.
  1449.                                    Only values which are not NULL are
  1450.                                    included.
  1451.  
  1452.           COUNT(*)                 COUNT(*) returns the number of
  1453.                                    records selected.
  1454.  
  1455.           MAX(Expression)          For each record selected, Expression
  1456.                                    is analyzed and a value obtained.
  1457.                                    MAX returns the maximum of these
  1458.                                    values.  Only values which are not
  1459.                                    NULL are included.
  1460.  
  1461.           MIN(Expression)          For each record selected, Expression
  1462.                                    is analyzed and a value obtained.
  1463.                                    MIN returns the minimum of these
  1464.                                    values.  Only values which are not
  1465.                                    NULL are included.
  1466.  
  1467.           SUM(Expression)          For each record selected, Expression
  1468.                                    is analyzed and a value obtained.
  1469.                                    SUM returns the sum of these values.
  1470.                                    Only values which are not NULL are
  1471.                                    included.
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.                                                       Built-in functions
  1490.           Orion SQL Syntax                                 Page 25 of 34
  1491.  
  1492.  
  1493.                                    Expressions
  1494.  
  1495.  
  1496.           Expressions can be:
  1497.  
  1498.                A column name
  1499.  
  1500.                A constant or literal value
  1501.  
  1502.                A built-in function
  1503.  
  1504.                An arithmetic combination of expressions
  1505.  
  1506.           Constants can be:
  1507.  
  1508.                Integer (for example: 100, -5, +127)
  1509.  
  1510.                Decimal (for example: 100.0, -.001, 1., +1.5)
  1511.  
  1512.                Floating point (for example: 1E10, -2E-7, +3.14159E0)
  1513.  
  1514.                Character string (for example: 'SMITH' '-@k9-22', '-1',
  1515.                'Orion')
  1516.  
  1517.           Order of execution:
  1518.  
  1519.                Arithmetic expressions are evaluated before comparisons
  1520.                and logical operations.
  1521.  
  1522.                Arithmetic expressions are evaluated left to right except
  1523.                that multiplication and division are performed before
  1524.                addition and subtraction.  Parentheses can be used to
  1525.                control the order of evaluation.
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.                                                              Expressions
  1552.           Orion SQL Syntax                                 Page 26 of 34
  1553.  
  1554.  
  1555.                                 Search Conditions
  1556.  
  1557.  
  1558.           A search condition can be a simple condition or a logical
  1559.           combination of conditions.  If the value of any expression is
  1560.           NULL then the condition evaluates to UNKNOWN:
  1561.  
  1562.           Simple conditions:
  1563.  
  1564.                Expression1 = Expression2
  1565.  
  1566.                          Evaluates to TRUE if and only if Expression1
  1567.                          has a value equal to that of Expression2,
  1568.                          otherwise the condition evaluates to FALSE.
  1569.  
  1570.                Expression1 < Expression2
  1571.  
  1572.                          Evaluates to TRUE if and only if Expression1
  1573.                          has a value less than that of Expression2,
  1574.                          otherwise the condition evaluates to FALSE.
  1575.  
  1576.                Expression1 <= Expression2
  1577.  
  1578.                          Evaluates to TRUE if and only if Expression1
  1579.                          has a value less than or equal to that of
  1580.                          Expression2, otherwise the condition evaluates
  1581.                          to FALSE.
  1582.  
  1583.                Expression1 > Expression2
  1584.  
  1585.                          Evaluates to TRUE if and only if Expression1
  1586.                          has a value greater than that of Expression2,
  1587.                          otherwise the condition evaluates to FALSE.
  1588.  
  1589.                Expression1 >= Expression2
  1590.  
  1591.                          Evaluates to TRUE if and only if Expression1
  1592.                          has a value greater than or equal to that of
  1593.                          Expression2, otherwise the condition evaluates
  1594.                          to FALSE.
  1595.  
  1596.                Expression1 <> Expression2
  1597.  
  1598.                          Evaluates to TRUE if and only if Expression1
  1599.                          has a value which is not equal to that of
  1600.                          Expression2, otherwise the condition evaluates
  1601.                          to FALSE.
  1602.  
  1603.                Expression1 [NOT] BETWEEN Expression2 AND Expression3
  1604.  
  1605.                          Same as [NOT] ((Expression2 <= Expression1) AND
  1606.                          (Expression1 <= Expression3).
  1607.  
  1608.                Expression1 [NOT] IN (Value1[, Value2] ...)
  1609.  
  1610.  
  1611.  
  1612.  
  1613.                                                        Search Conditions
  1614.           Orion SQL Syntax                                 Page 27 of 34
  1615.  
  1616.  
  1617.                          Same as [NOT] ((Expression1 = Value1)[ OR
  1618.                          (Expression1 = Value2)] ... .
  1619.  
  1620.                Expression1 [NOT] IN (Subquery)
  1621.  
  1622.                          TRUE if Expression1 is [not] equal to any value
  1623.                          returned by Subquery.
  1624.  
  1625.                ColumnName [NOT] LIKE Pattern
  1626.  
  1627.                          Only available for character types: [not] TRUE
  1628.                          if the string in the specified column matches
  1629.                          Pattern.  In Pattern, '_' matches any single
  1630.                          character, '%' matches any character sequence.
  1631.  
  1632.                ColumnName IS [NOT] NULL
  1633.  
  1634.                          True if the value of ColumnName is [not] NULL.
  1635.  
  1636.                [NOT] EXISTS (Subquery)
  1637.  
  1638.                          [Not] TRUE if Subquery returns at least one
  1639.                          record.
  1640.  
  1641.                Expression1 [NOT] IN (Subquery)
  1642.  
  1643.                          [Not] TRUE if Subquery returns at least one
  1644.                          value which is equal to Expression1.
  1645.  
  1646.                Expression1 = [ANY | ALL | SOME] (Subquery)
  1647.                Expression1 < [ANY | ALL | SOME] (Subquery)
  1648.                Expression1 <= [ANY | ALL | SOME] (Subquery)
  1649.                Expression1 > [ANY | ALL | SOME] (Subquery)
  1650.                Expression1 >= [ANY | ALL | SOME] (Subquery)
  1651.                Expression1 <> [ANY | ALL | SOME] (Subquery)
  1652.  
  1653.                          Please refer to a text book for a description
  1654.                          of the "quantified" predicate.  While
  1655.                          supported, we recommend against its use.
  1656.  
  1657.           Logical combination of conditions:
  1658.  
  1659.                NOT Condition
  1660.  
  1661.                          Evaluates to TRUE if and only if Condition is
  1662.                          FALSE.  Evaluates to FALSE if and only if
  1663.                          Condition is TRUE.
  1664.  
  1665.                Condition1 AND Condition2
  1666.  
  1667.                          Evaluates to TRUE if and only if both
  1668.                          Condition1 and Condition2 are TRUE.
  1669.  
  1670.                Condition1 OR Condition2
  1671.  
  1672.  
  1673.  
  1674.  
  1675.                                                        Search Conditions
  1676.           Orion SQL Syntax                                 Page 28 of 34
  1677.  
  1678.  
  1679.                          Evaluates to TRUE if either Condition1 or
  1680.                          Condition2 is TRUE or both are TRUE.  Evaluates
  1681.                          to TRUE even if one condition is UNKNOWN.
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.                                                        Search Conditions
  1738.           Orion SQL Syntax                                 Page 29 of 34
  1739.  
  1740.  
  1741.                                   System Catalog
  1742.  
  1743.  
  1744.           The system catalog is composed of four tables: SYSTEM.COLUMNS,
  1745.           SYSTEM.INDICES, SYSTEM.TABLES and SYSTEM.USERS.  All these
  1746.           tables belong to the user "SYSTEM".  These tables are
  1747.           maintained by the Orion Database Administrator.
  1748.  
  1749.           Unless otherwise indicated, you must not modify the
  1750.           SYSTEM.COLUMNS, SYSTEM.INDICES, SYSTEM.TABLES and SYSTEM.USERS
  1751.           tables.
  1752.  
  1753.           COLUMNS        This table contains information about all
  1754.                          columns of all tables in the database.
  1755.  
  1756.           INDICES        This table contains information about all
  1757.                          indices in the database.  When more than one
  1758.                          column is included in an index, there is a
  1759.                          separate record for each column included.
  1760.  
  1761.           TABLES         This table contains information about all
  1762.                          tables in the database.
  1763.  
  1764.           USERS          This table contains information about all users
  1765.                          known to the database.
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.                                                           System Catalog
  1800.           Orion SQL Syntax                                 Page 30 of 34
  1801.  
  1802.  
  1803.                           System Catalog: SYSTEM.COLUMNS
  1804.  
  1805.  
  1806.           This table contains information about all columns of all
  1807.           tables in the database.  You may only modify the REMARK field
  1808.           of records in this table.
  1809.  
  1810.           Column         Type/Description
  1811.  
  1812.           SEQUENCE_NUMBER SMALLINT Indicates the position of the column
  1813.                          within the table.
  1814.  
  1815.           LENGTH         SMALLINT Indicates the length of character
  1816.                          strings or the precision of numeric values.
  1817.  
  1818.           SCALE          SMALLINT Indicates the scale of numeric values.
  1819.  
  1820.           DATA_TYPE      VARCHAR(32) Indicates data type.
  1821.  
  1822.           NOT_NULL       CHARACTER(5) Indicates whether NULL values are
  1823.                          allowed.  TRUE indicates NULL is not allowed.
  1824.  
  1825.           USER_NAME      VARCHAR(32) Indicates the user name of the
  1826.                          owner of the table.
  1827.  
  1828.           TABLE_NAME     VARCHAR(32) Indicates the name of the table.
  1829.  
  1830.           COLUMN_NAME    VARCHAR(32) Indicates the name of the column.
  1831.  
  1832.           REMARK         VARCHAR(128) A comment.
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.                                           System Catalog: SYSTEM.COLUMNS
  1862.           Orion SQL Syntax                                 Page 31 of 34
  1863.  
  1864.  
  1865.                           System Catalog: SYSTEM.INDICES
  1866.  
  1867.  
  1868.           This table contains information about all indices in the
  1869.           database.  When more than one column is included in an index,
  1870.           there is a separate record for each column included.  You may
  1871.           only modify the REMARK field of records in this table.
  1872.  
  1873.           The INDEX_NAME of indices created to enforce unique
  1874.           constraints have a '~' as their first character.
  1875.  
  1876.           Column         Description
  1877.  
  1878.           USER_NAME      VARCHAR(32) Indicates the user name of the
  1879.                          owner of the table upon which the index is
  1880.                          constructed.
  1881.  
  1882.           TABLE_NAME     VARCHAR(32) Indicates the name of the table
  1883.                          upon which the index is constructed.
  1884.  
  1885.           INDEX_NAME     VARCHAR(32) Indicates the name of the index.
  1886.  
  1887.           SEGMENT_NUMBER SMALLINT Indicates the position of the column
  1888.                          within the index key.
  1889.  
  1890.           NUMBER_OF_SEGMENTS SMALLINT Indicates the number of columns
  1891.                          included in the index key.
  1892.  
  1893.           DESCENDING     CHARACTER(5) Indicates whether the index is
  1894.                          marked as ascending or descending.  ASC
  1895.                          indicates ascending while DESC indicates
  1896.                          descending.
  1897.  
  1898.           UNIQUE         CHARACTER(5) Indicates whether duplicate values
  1899.                          are allowed.  TRUE indicates all values must be
  1900.                          distinguishable, one from another.  FALSE
  1901.                          indicates duplicate values are allowed.
  1902.  
  1903.           CREATOR_NAME   VARCHAR(32) Indicates the user name of the
  1904.                          creator of the index.
  1905.  
  1906.           COLUMN_NAME    VARCHAR(32) Indicates the name of the column
  1907.                          which makes up this segment of the index key.
  1908.  
  1909.           REMARK         VARCHAR(128) A comment.
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.                                           System Catalog: SYSTEM.INDICES
  1924.           Orion SQL Syntax                                 Page 32 of 34
  1925.  
  1926.  
  1927.                           System Catalog: SYSTEM.TABLES
  1928.  
  1929.  
  1930.           This table contains information about all tables in the
  1931.           database.  You may only modify the REMARK field of records in
  1932.           this table.
  1933.  
  1934.           The TABLE_NAME of temporary tables used during the execution
  1935.           of a query have a '~' as their first character.
  1936.  
  1937.           Column         Description
  1938.  
  1939.           TABLE_ID       SMALLINT Used internally to identify the MSDOS
  1940.                          files used in the table.
  1941.  
  1942.           NUMBER_OF_COLUMNS SMALLINT Indicates the number of columns in
  1943.                          the table.
  1944.  
  1945.           ISAM_CONTROL_BLOCK BINARY Used internally to save the ISAM
  1946.                          control block for the table.
  1947.  
  1948.           USER_NAME      Indicates the name of the user who owns the
  1949.                          table.
  1950.  
  1951.           TABLE_NAME     VARCHAR(32) Indicates the name of the table.
  1952.  
  1953.           REMARK         VARCHAR(128) A comment.
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.                                            System Catalog: SYSTEM.TABLES
  1986.           Orion SQL Syntax                                 Page 33 of 34
  1987.  
  1988.  
  1989.                            System Catalog: SYSTEM.USERS
  1990.  
  1991.  
  1992.           This table contains information about all users known to the
  1993.           database.
  1994.  
  1995.           You may manage user access by modifying the SYSTEM.USERS
  1996.           table.  Use Caution: deleting all user records will
  1997.           permanently lock you out of the database.  Do not delete the
  1998.           user "SYSTEM".
  1999.  
  2000.           Column         Description
  2001.  
  2002.           USER_NAME      VARCHAR(32) Indicates a user name.
  2003.  
  2004.           USER_PASSWORD  VARCHAR(32) Indicates a user password.
  2005.  
  2006.           REMARK         VARCHAR(128) A comment.
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.                                             System Catalog: SYSTEM.USERS
  2048.           Orion SQL Syntax                                 Page 34 of 34
  2049.  
  2050.  
  2051.                                      Glossary
  2052.  
  2053.  
  2054.           current user             The current user is the user who
  2055.                                    logged into the database to execute
  2056.                                    the query.
  2057.  
  2058.           key                      A key is the set of columns within a
  2059.                                    table used to construct an index on
  2060.                                    that table.
  2061.  
  2062.           key value                The database administrator creates a
  2063.                                    key value by concatenating the values
  2064.                                    of all columns defined in an index.
  2065.                                    The columns are concatenated in the
  2066.                                    order in which they were specified
  2067.                                    when the index was created.
  2068.  
  2069.           result table             All SELECT queries generate a table
  2070.                                    containing the chosen records.  This
  2071.                                    is called the result table.  Its
  2072.                                    contents are made available to you
  2073.                                    one at a time through one of the
  2074.                                    Orion SQL API fetch Statements.
  2075.  
  2076.           transaction journal      A transaction journal is a pair of
  2077.                                    files ('or_log.dat' and 'or_log.idx')
  2078.                                    written by the database manager.  The
  2079.                                    transaction journal contains a record
  2080.                                    of every event which caused a change
  2081.                                    to the database.
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.                                                                 Glossary